--淬火再回
local cuihuozaihui = fk.CreateSkill {
    name = "mcdh_cuihuozaihui",
    tags = {Skill.Compulsory}
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

cuihuozaihui:addEffect(fk.DamageCaused,{
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0  then
            return data.damage and data.damageType ~= fk.FireDamage and data.from == player
        end
    end,
    on_use = function(self, event, target, player, data)
            data.damage = data.damage + 1
    end
})

cuihuozaihui:addEffect( fk.Damaged,{
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0  then
            return data.damage and data.damageType ~= fk.FireDamage and data.to == player
        end
    end,
    on_use = function(self, event, target, player, data)
            player.room:recover({
                who = player,
                num = 1,
                recoverBy = player,
                skillName = self.name
            })
    end
})

cuihuozaihui:addEffect(fk.EnterDying ,{
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0  then
            return data.damage and data.damage.damageType ~= fk.NormalDamage
        end
    end,
    on_use = function(self, event, target, player, data)
        player:drawCards(2, self.name)
    end
})

Fk:loadTranslationTable {
    ["mcdh_cuihuozaihui"] = "淬火再回",
    [":mcdh_cuihuozaihui"] = "『淬火再回』<br>锁定技，每回合限一次：<br>1. 当你造成的火焰伤害时，伤害值+1；<br>2. 当你受到火焰伤害后，你回复1点体力；<br>3. 当一名角色因属性伤害进入濒死状态时，你摸两张牌。",
}

return cuihuozaihui